package com.qingluan.server;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class BroadCastRecevier extends BroadcastReceiver{
	//context area
	private String tag = this.getClass().getName();
	public static final String KEY = "MessagePush";
	//widget area
	private ReceiveListener receiveListener;
	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO Auto-generated method stub
		Bundle bundle = intent.getExtras();

		String infoString  = bundle.getString(KEY);
		receiveListener.receive(infoString);
		Log.d(tag, infoString);
	}

	public void setReceiveListenr(ReceiveListener receiveListener){
		this.receiveListener = receiveListener;
	}
	public interface ReceiveListener{
		public void receive(String info);
	}
}
